Custom Printer Library  1.17
ccw_Error.h
Go to the documentation of this file.
1 
2 
3 // File Revision
4 // Rev 1.00
5 //
6 // Rev. notes:
7 // - rel 1.00: first release
8 // NOTE: Please DO NOT EDIT THIS FILE
9 
14 
15 #ifndef _COMMON_CCW_ERROR_H__
16 #define _COMMON_CCW_ERROR_H__
17 
18 #include "WinTypes.h"
19 
23 typedef enum : DWORD
24 {
27 
30 
33 
36 
39 
42 
45 
48 
51 
54 
57 
60 
63 
66 
69 
72 
75 
78 
81 
84 
87 
90 
92  CcwResult_UnknowError = 0xFFFFFFFF,
93 
94 } CcwResult;
95 
96 
97 
98 
99 // Hide in documentation
101 
102 typedef struct
103 {
104  CcwResult ccwError;
105  const char* strDescription;
106 } CcwErrorType;
107 
108 //Errors List Size
109 #define ERROR_CCW_LISTSIZE (sizeof(ERROR_CCW_LIST)/sizeof(CcwErrorType))
110 
111 //Errors List description
112 const CcwErrorType ERROR_CCW_LIST[] = {
113  // Error // Error Descrition
114  { CcwResult_OK, "Ok" },
115  { CcwResult_OpenDeviceError, "Open port or device Error" },
116  { CcwResult_UnsupportedFunction, "Function not supported by this device" },
117  { CcwResult_InvalidParameter, "Parameter value not valid" },
118  { CcwResult_SmallBuffer, "Buffer small" },
119  { CcwResult_NullPointer, "A parameter is NUL" },
120  { CcwResult_NotInitialized, "Library not initialized" },
121  { CcwResult_InvalidDeviceID, "Device ID not valid or unknown" },
122  { CcwResult_ReadError, "Read data error" },
123  { CcwResult_WriteError, "Write data error" },
124  { CcwResult_UnsupportedDevice, "Device unknown or unsupported" },
125  { CcwResult_CommunicationError, "Communication error" },
126  { CcwResult_BarcodeUnsupportedError, "Barcode type unknown or unsupported" },
127  { CcwResult_BarcodeWidthError, "Barcode width wrong or bigger than print width" },
128  { CcwResult_DeviceAlreadyOpenError, "Device already open" },
129  { CcwResult_PrinterNotExistError, "Printer not found" },
130  { CcwResult_UnknowPrinterError, "Unknown Printer" },
131  { CcwResult_OpenFileError, "File not found or open error" },
132  { CcwResult_CommunicationError, "The communication with the device is busy" },
133  { CcwResult_GraphicsLibraryNotFound,"Graphics library not found or not loaded correctly" },
134  { CcwResult_BarcodeDataLongError, "Barcode data is too long or too short for selected symbology" },
135  { CcwResult_BarcodeInvalidDataError,"Barcode data includes characters which are not permitted by selected symbology" },
136 
137 };
138 
139 
140 // @endcond
141 
142 
150 static const char* CcwResultToText(CcwResult result)
151 {
152  DWORD i;
153 
154  for (i = 0; i < ERROR_CCW_LISTSIZE; i++){
155  if (ERROR_CCW_LIST[i].ccwError == result)
156  return ERROR_CCW_LIST[i].strDescription;
157  }
158 
159  return "Unknown Error";
160 }
161 
162 
163 #endif
All OK.
Definition: ccw_Error.h:26
Barcode invalid data error (data includes characters which are not permitted by selected symbology) ...
Definition: ccw_Error.h:89
Error communication data.
Definition: ccw_Error.h:59
Communication busy.
Definition: ccw_Error.h:80
Write error.
Definition: ccw_Error.h:53
File not found or error during the open.
Definition: ccw_Error.h:77
Printer doesn&#39;t exist Error.
Definition: ccw_Error.h:71
Unknow Error.
Definition: ccw_Error.h:92
Barcode width Error.
Definition: ccw_Error.h:65
CcwResult
Definition: ccw_Error.h:23
Invalid parameter.
Definition: ccw_Error.h:35
Printer unknow Error.
Definition: ccw_Error.h:74
Small buffer.
Definition: ccw_Error.h:38
Unsupported Device.
Definition: ccw_Error.h:56
Null or invalid pointer.
Definition: ccw_Error.h:41
Barcode type unsupported.
Definition: ccw_Error.h:62
Barcode data length error (data is too long or too short for selected symbology)
Definition: ccw_Error.h:86
Library not initialized.
Definition: ccw_Error.h:44
Graphics library not found.
Definition: ccw_Error.h:83
Open Port/Device Error.
Definition: ccw_Error.h:68
Invalid device ID.
Definition: ccw_Error.h:47
static const char * CcwResultToText(CcwResult result)
Definition: ccw_Error.h:150
The device doesn&#39;t answer.
Definition: ccw_Error.h:50
Unsupported Function.
Definition: ccw_Error.h:32
Open Port/Device Error.
Definition: ccw_Error.h:29